home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
47215
/
47215.xpi
/
chrome
/
content
/
lib
/
urls.js
< prev
next >
Wrap
Text File
|
2009-11-22
|
784b
|
31 lines
(function()
{
//removes the schema of an URL
this.removeSchema = function(aURL)
{
if(!aURL)
return '';
var schema = aURL.replace(/^([^\:]*):.*$/, "$1");
var rX= new RegExp('^'+schema+'\:\/+','i');
return aURL.replace(rX, '');
}
//remove the ww. ww09. www09. ww-09. www-09. www. www09. es-en.www. es.www09. (and probably others) from a domain name
/*
http://www-142.ibm.com/software/products/uy/es/category/SWF00
http://es-es.www.mozilla.org/
*/
this.removeWWW = function(aDomain)
{
if(!aDomain)
return '';
var withoutAZ09WWW = aDomain.replace(/^([a-z]|[0-9]|-)+\.www?-?([0-9]+)?\./i, '');
if(aDomain != withoutAZ09WWW)
return withoutAZ09WWW;
else
return aDomain.replace(/^www?-?([0-9]+)?\./i, '');
}
return null;
}).apply(URLtoTabTitle);